package com.example.module2.slice;

import com.example.module2.ResourceTable;
import com.example.router.annotation.Router;
import com.example.routercore.HRouter;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Component;

@Router(path = "/module2/ModuleAbility2Slice")
public class ModuleAbility2Slice extends AbilitySlice {
    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_ability_module_2);

        findComponentById(ResourceTable.Id_text_helloworld).setClickedListener(new Component.ClickedListener() {
            @Override
            public void onClick(Component component) {
                HRouter.getInstance().build("/main/MainAbility").navigation(ModuleAbility2Slice.this);
            }
        });
    }

    @Override
    public void onActive() {
        super.onActive();
    }

    @Override
    public void onForeground(Intent intent) {
        super.onForeground(intent);
    }
}
